package cn.redragon.soa.common.config.rabbit;

import com.rabbitmq.client.Channel;
import java.util.Map;
import lombok.Data;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "spring.rabbitmq.listener.simple.retry")
@Data
@ConditionalOnClass({RabbitTemplate.class, Channel.class})
public class RetryProperties {

    private boolean enabled;

    private long initialInterval;

    private double multiplier;

    private long maxInterval;

    private int maxAttempts;

    private Map<Class<? extends Throwable>, Boolean> retryableExceptions;
}
